package xmu.zfw.domain;

import lombok.Data;

import java.io.Serializable;
import java.util.List;


@Data
public class Reporteder implements Serializable {
    private Integer id;
    private String name;
    private String department;

    public Boolean compare(List<Reporteder> reportederList){
        for(Reporteder reporteder: reportederList){
            if(compare(reporteder)){
                return true;
            }
        }
        return false;
    }

    private Boolean compare(Reporteder reporteder){
        if(name != null && !name.equals(reporteder.getName())){
            return false;
        }
        if(department != null && !department.equals(reporteder.getDepartment())){
            return false;
        }
        return true;
    }
}
